package lbm.exercise;

public class Test1 {
    public static void main(String[] args) {
        Animal animal = new Animal();
        animal.setName("nihao");

        String newName = null;
        if(animal.getName()!=null && !(animal.getName().isEmpty())){
            newName = animal.getName();
        }

        if(newName != null){
            System.out.println("keyi");
        }
    }
}

class Animal{
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}